package org.zsl.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zsl.model.User;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return  "hello";
    }

    @RequestMapping("/json")
    @ResponseBody
    public String json(){

        User user = new User();
        user.setUsername("admin");

       return JSON.toJSONString(user);
    }
}
